/*
 * @WebService(serviceName = "courseService")
 *
 */
package edu.depaul.se.courseregistration.webservice;

import edu.depaul.se.courseregistration.jpa.courses.College;
import edu.depaul.se.courseregistration.jpa.courses.Course;
import edu.depaul.se.courseregistration.jpa.courses.Section;
import edu.depaul.se.courseregistration.jpa.courses.Subject;
import edu.depaul.se.courseregistration.sessionbean.CourseSession;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

/**
 *
 * @author lmarco
 */
//@WebService(serviceName = "courseService")
@Stateless()
public class CourseService {

    @EJB
    private CourseSession courseSession1;
    
    @WebMethod(operationName = "getAllCourses")
    public List <Course>  getAllCourses() {
        return courseSession1.getAllCourse();
    }
    
     @WebMethod(operationName = "findCourseBySubject")
     public List<Course> findCourseBySubject(@WebParam (name = "subjectId") int subjectId) {
        return courseSession1.findCourseBySubject(subjectId);
    }
  
    @WebMethod(operationName = "findCourseById")
    public Course findCourseById(@WebParam (name = "courseId")int courseId) {
        return courseSession1.findCourseById(courseId);
    }
    
    @WebMethod(operationName = "findCourseByTitle")
    public Course findCourseByTitle(@WebParam (name = "courseTitle") String courseTitle) {
         return courseSession1.findCourseByTitle(courseTitle);
    } 
    
    @WebMethod(operationName = "getAllSections")
    public List<Section> getAllSections() {
        return courseSession1.getAllSections();
    }
    @WebMethod(operationName = "findSectionById")
    public Section findSectionById(@WebParam (name = "sectionId")int sectionId) {
        return courseSession1.findSectionById(sectionId);
    }
    
    
   @WebMethod(operationName = "findSectionByCourse")
   public List <Section> findSectionByCourse(@WebParam (name = "courseId")int courseId) {
        return courseSession1.findSectionByCourse(courseId);
    }
    
    @WebMethod(operationName = "findSectionByIsOpen")
    public List <Section> findSectionByIsOpen(@WebParam (name = "isOpen") boolean isOpen) {
         return courseSession1.findSectionByIsOpen(isOpen);
    }

    @WebMethod(operationName = "getAllSubjects")
    public List<Subject> getAllSubjects() {
         return courseSession1.getAllSubjects();
    }
    
    @WebMethod(operationName = "findSubjectByCollege")
    public List <Subject> findSubjectByCollege(@WebParam (name = "collegeId")int collegeId) {
        return courseSession1.findSubjectByCollege(collegeId);
    }
    @WebMethod(operationName = "findSubjectById")
    public Subject findSubjectById(@WebParam (name = "subjectId") int subjectId) {
        return courseSession1.findSubjectById(subjectId);
    }
    
    @WebMethod(operationName = "findSubjectByCode")
    public Subject findSubjectByCode(@WebParam (name = "subjectCode") String subjectCode) {
        return courseSession1.findSubjectByCode(subjectCode);
    }
    
    @WebMethod(operationName = "getAllColleges")
    public List<College> getAllColleges() {
        return courseSession1.getAllColleges();
    }
    
    @WebMethod(operationName = "findCollegeById")
    public College findCollegeById(@WebParam (name = "collegeId")int collegeId) {
           return courseSession1.findCollegeById(collegeId);
    }
    
    @WebMethod(operationName = "findCollegeByShortName")
    public College findCollegeByShortName(@WebParam (name = "collegeShortName") String collegeShortName) {
        return courseSession1.findCollegeByShortName(collegeShortName);
    }  
}
